<?php
$smarty->configLoad($lang . '/calendar.module.php');
$language = parse_ini_file($lang . '/breadcrumb.module.php', true);
$breadcrumb = $language['calendar'];

$user = new user;
$value = '';
$sql = 'SELECT * FROM '.DB_CMS.'.module_calendar';
$dbh = $connection->query($sql);
foreach ($dbh as $project) {
	if (!empty($_GET['calendarID'])) {
		if (empty($project['reason'])) {
			$reason = ' - Keine Aufgabe definiert';
		} else {
			$reason = ' - ' . $project['reason'];
		}
	}
	$entry = array(
		'title' => $user->getName($project['userID']),
		'start' => "$project[start]",
		'end' => "$project[end]",
		'color' => "#232323",
		'allDay' => true,
		'url' => 'index.php?mod=profile&userID=' . $project['userID'] . '',
		'textColor' => "#ffffff"
	);
	$value[] = $entry;
}
$value = json_encode($value);
$smarty->assign('value', $value);

$template = 'calendar/index.tpl';
?>
 
